//
//  ActivityInfoDetailCell.m
//  SDSY
//
//  Created by 蓝布鲁 on 2017/4/5.
//  Copyright (c) 2017 蓝布鲁. All rights reserved.
//

#import "ActivityInfoDetailCell.h"
#import "ActivityInfoModel.h"

@interface ActivityInfoDetailCell()

@property (nonatomic)ActivityInfoDetailCellType type;

@end

@implementation ActivityInfoDetailCell

- (instancetype)initWithCellType:(ActivityInfoDetailCellType)type {
    if(self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CELLID"]) {
        self.type = type;
    }
    return self;
}

#pragma mark - 重写父类方法
- (void)setupView {
    [super setupView];
}

- (void)setModel:(ActivityInfoModel *)model {
    if(self.type == ActivityInfoDetailCellStartTimeType) {
        // 活动开始时间
        [self.imageView setImage:[UIImage imageNamed:@"activity_date"]];
        self.textLabel.text = [NSString stringWithFormat:@"%@ ~ %@",model.starttime,model.endtime];
    }if (self.type == ActivityInfoDetailCellLocationType) {
        // 活动地点
        [self.imageView setImage:[UIImage imageNamed:@"activity_location"]];
        self.textLabel.text = model.address;

        // 设置可点击
//        self.selectionStyle = UITableViewCellSelectionStyleDefault;
//        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }if (self.type == ActivityInfoDetailCellOrderedNumberType) {
        // 已预约人数
        [self.imageView setImage:[UIImage imageNamed:@"activity_people"]];
        self.textLabel.text = [NSString stringWithFormat:@"已预约%@人/限预约%@人",model.reservationnum,model.maxnum];
    }if (self.type == ActivityInfoDetailCellCanGetCreditType) {
        // 可获得学分
        [self.imageView setImage:[UIImage imageNamed:@"activity_hot"]];
        self.textLabel.text = [NSString stringWithFormat:@"可获得学分:%@分",model.credit];
    }

}

@end
